package cn.classyex.business.hr.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import cn.classyex.business.hr.mapper.EmployeePerformanceMapper;
import cn.classyex.business.hr.domain.EmployeePerformance;
import cn.classyex.business.hr.service.IEmployeePerformanceService;
import com.ruoyi.common.core.text.Convert;

/**
 * 员工绩效管理Service业务层处理
 * 
 * @author yex
 * @date 2021-05-06
 */
@Service
public class EmployeePerformanceServiceImpl implements IEmployeePerformanceService 
{
    @Autowired
    private EmployeePerformanceMapper employeePerformanceMapper;

    /**
     * 查询员工绩效管理
     * 
     * @param employeePerformanceId 员工绩效管理ID
     * @return 员工绩效管理
     */
    @Override
    public EmployeePerformance selectEmployeePerformanceById(Long employeePerformanceId)
    {
        return employeePerformanceMapper.selectEmployeePerformanceById(employeePerformanceId);
    }

    /**
     * 查询员工绩效管理列表
     * 
     * @param employeePerformance 员工绩效管理
     * @return 员工绩效管理
     */
    @Override
    public List<EmployeePerformance> selectEmployeePerformanceList(EmployeePerformance employeePerformance)
    {
        return employeePerformanceMapper.selectEmployeePerformanceList(employeePerformance);
    }

    /**
     * 新增员工绩效管理
     * 
     * @param employeePerformance 员工绩效管理
     * @return 结果
     */
    @Override
    public int insertEmployeePerformance(EmployeePerformance employeePerformance)
    {
        employeePerformance.setCreateTime(DateUtils.getNowDate());
        return employeePerformanceMapper.insertEmployeePerformance(employeePerformance);
    }

    /**
     * 修改员工绩效管理
     * 
     * @param employeePerformance 员工绩效管理
     * @return 结果
     */
    @Override
    public int updateEmployeePerformance(EmployeePerformance employeePerformance)
    {
        employeePerformance.setUpdateTime(DateUtils.getNowDate());
        return employeePerformanceMapper.updateEmployeePerformance(employeePerformance);
    }

    /**
     * 删除员工绩效管理对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteEmployeePerformanceByIds(String ids)
    {
        return employeePerformanceMapper.deleteEmployeePerformanceByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除员工绩效管理信息
     * 
     * @param employeePerformanceId 员工绩效管理ID
     * @return 结果
     */
    @Override
    public int deleteEmployeePerformanceById(Long employeePerformanceId)
    {
        return employeePerformanceMapper.deleteEmployeePerformanceById(employeePerformanceId);
    }
}
